<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title></title>
</head>
<body>
<div id="app">
  <h1>{{title}}</h1>
  <!-- 使用组件 -->
  <login></login>
  <hr>
  <login><span slot="param1">+</span><span slot="param2">成功</span></login>

</div>
</body>
</html>

<script src="../js/v2.6.10/vue.js"></script>
<script>

  const login = {
    template: `
          <div><slot name="param1"></slot><h2>用户登录</h2><slot name="param2"></slot></div>`,
    data() {//用来给当前组件
      return {
      }
    },
  }

  const app = new Vue({
    el: "#app",
    data: {
      title:'插槽 Slots'
    },
    methods: {

    },
    components: {
      //注册局部组件
      login
    }
  });

</script>